@echo off
set PROC_NAME=wxbot-sidecar.exe
set SCRIPT_NAME=%cd%\wx.py
set PYTHON_EXE=%cd%\python\python.exe

for /f "tokens=2 delims=," %%a in ('tasklist /nh /fo csv /v ^| findstr /i "%PYTHON_EXE%"') do (
   if "%%~a" neq "" (
      for /f "tokens=*" %%b in ("%%~a") do (
         if "%%~b" equ "%PYTHON_EXE% %SCRIPT_NAME%" (
            echo running
            goto :eof
         )
      )
   )
)

echo bot not running
@REM start %PYTHON_EXE% %SCRIPT_NAME%
@REM tasklist | find /i "%PROC_NAME%" >nul
@REM if errorlevel 1 (
@REM     echo starting...
@REM     start %cd%\bin\wxbot-sidecar.exe -w -b -c %cd%\bin\wxbot.json
@REM ) else (
@REM     echo aleady running
@REM )
pause